package com.haixiaoke.saas.house.mapper;

import com.haixiaoke.saas.house.domain.House;
import com.haixiaoke.saas.house.domain.SubHouse;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 房屋子房间Mapper接口
 *
 * @author panda
 * @date 2023-10-25
 */
public interface SubHouseMapper {
    /**
     * 查询房屋子房间
     *
     * @param subordinateHouseId 房屋子房间主键
     * @return 房屋子房间
     */
    SubHouse selectSubordinateHouseBySubordinateHouseId(String subHouseId);

    /**
     * 查询房屋子房间列表
     *
     * @param subordinateHouse 房屋子房间
     * @return 房屋子房间集合
     */
    List<SubHouse> selectSubordinateHouseList(SubHouse subordinateHouse);

    /**
     * 新增房屋子房间
     *
     * @param subordinateHouse 房屋子房间
     * @return 结果
     */
    int insertSubordinateHouse(SubHouse subordinateHouse);

    /**
     * 修改房屋子房间
     *
     * @param subordinateHouse 房屋子房间
     * @return 结果
     */
    int updateSubordinateHouse(SubHouse subordinateHouse);

    /**
     * 删除房屋子房间
     *
     * @param subordinateHouseId 房屋子房间主键
     * @return 结果
     */
    int deleteSubordinateHouseBySubordinateHouseId(String subHouseId);

    /**
     * 批量删除房屋子房间
     *
     * @param subordinateHouseIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteSubordinateHouseBySubordinateHouseIds(String[] subordinateHouseIds);

    /**
     * 批量插入子房间数据
     *
     * @param subordinateHouseList
     * @return
     */
    int insertBatchSubordinateHouse(List<SubHouse> subordinateHouseList);

    /**
     * 统计子房间总数
     *
     * @return
     */
    int selectHouseByHouseNumber();

    /**
     * 统计指定房屋状态、指定租赁方式的房屋的数量
     *
     * @param houseState
     * @param houseLeaseState
     * @param houseMaintainState
     * @param onlineRentalType
     * @return
     */
    int selectHouseCountByHouseState(@Param("houseState") String houseState, @Param("houseLeaseState") String houseLeaseState, @Param("houseMaintainState") String houseMaintainState, @Param("onlineRentalType") String onlineRentalType,@Param("tenantId") String tenantId);

    /**
     * 批量修改子房间数据
     *
     * @param subordinateHouseList
     * @return
     */
    int updateBatchSubordinateHouse(List<SubHouse> subordinateHouseList);

    List<SubHouse> selectSubordinateHouseByHouseId(String houseId);

    /**
     * 根据房屋id删除子房间数据
     * @param houseId
     * @return
     */
    int softDeleteSubordinateHouseByHouseIds(String houseId);


    List<House> selectSubHouseListConvertHouse(House house);
}
